package com.distribute.framework.config;

import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.distribute.framework.core.web.Lazy3qDispatcher;
import com.distribute.framework.core.web.servlet.upload.UpLoadServlet;

@Configuration
public class WebDispatcher {

	@Bean
    public FilterRegistrationBean filterWebDispatcherRegistration() {
        FilterRegistrationBean registration = new FilterRegistrationBean();
        //注入过滤器
        registration.setFilter(new Lazy3qDispatcher());
        //拦截规则
        registration.addUrlPatterns("*.do");
        registration.addUrlPatterns("*.action");
        //过滤器名称
        registration.setName("WebDispatcher");
        //是否自动注册 false 取消Filter的自动注册
        registration.setEnabled(true);
        //过滤器顺序
        registration.setOrder(1);
        return registration;
    }

	
}